package com.leonzhangxf.ioc.importation;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * The demo of use application-context's import selector {@link org.springframework.context.annotation.ImportSelector}.
 *
 * @author leonzhangxf
 */
@Configuration
@ComponentScan({"com.leonzhangxf.ioc.importation"})
@EnableHello(hello = HelloEnum.HELLO_LEON)
public class ApplicationContextForImportSelectorStarter {


    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext =
            new AnnotationConfigApplicationContext(ApplicationContextForImportSelectorStarter.class);

        HelloService helloService = applicationContext.getBean(HelloService.class);
        helloService.hello();
    }
}
